package com.example.service.impl;

import com.example.Pojo.DeptLog;
import com.example.mapper.DeptLogMapper;
import com.example.service.DeptLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


@Service
public class DeptLogServiceIml implements DeptLogService {
    @Autowired
    private DeptLogMapper deptLogMapper;

    //添加这个事务属性之后,不管当前执行的操作有没有执行成功,这里都会进行日志是输出
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @Override
    public void insert(DeptLog deptLog) {
        deptLogMapper.insert(deptLog);
    }
}
